package com.ruoyi.lvlian.service.impl;

import java.util.List;

import com.ruoyi.common.core.utils.MD5Utils;
import com.ruoyi.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lvlian.mapper.MapLabelMapper;
import com.ruoyi.lvlian.domain.MapLabel;
import com.ruoyi.lvlian.service.IMapLabelService;

/**
 * 地图标签Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class MapLabelServiceImpl implements IMapLabelService {
    @Autowired
    private MapLabelMapper mapLabelMapper;

    /**
     * 查询地图标签
     *
     * @param position 地图标签主键
     * @return 地图标签
     */
    @Override
    public MapLabel selectMapLabelByPosition(String position) {
        return mapLabelMapper.selectMapLabelByPosition(position);
    }

    /**
     * 查询地图标签列表
     *
     * @param mapLabel 地图标签
     * @return 地图标签
     */
    @Override
    public List<MapLabel> selectMapLabelList(MapLabel mapLabel) {
        return mapLabelMapper.selectMapLabelList(mapLabel);
    }

    /**
     * 新增地图标签
     *
     * @param mapLabel 地图标签
     * @return 结果
     */
    @Override
    public int insertMapLabel(MapLabel mapLabel) {
        return mapLabelMapper.insertMapLabel(mapLabel);
    }

    /**
     * 修改地图标签
     *
     * @param mapLabel 地图标签
     * @return 结果
     */
    @Override
    public int updateMapLabel(MapLabel mapLabel) {


        return mapLabelMapper.insertMapLabel(mapLabel);
//        return mapLabelMapper.updateMapLabel(mapLabel);
    }

    /**
     * 批量删除地图标签
     *
     * @param positions 需要删除的地图标签主键
     * @return 结果
     */
    @Override
    public int deleteMapLabelByPositions(String[] positions) {
        return mapLabelMapper.deleteMapLabelByPositions(positions);
    }

    /**
     * 删除地图标签信息
     *
     * @param position 地图标签主键
     * @return 结果
     */
    @Override
    public int deleteMapLabelByPosition(String position) {
        return mapLabelMapper.deleteMapLabelByPosition(position);
    }
}
